<!--# layout("/common/layout.html",{"jsBase":"/js/ncode/ncodebatch/"}){ -->
<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="batchId" id="batchId" value="${batchId}">
    <br/>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">日期</label>
				<div class="layui-input-inline">
                    <input type="text" name="date"  id="date" autocomplete="off" class="layui-input input-date" >
				</div>
            </div>
        </div>
        <layui:submitButtons id="addButton" />
    </div>

</form>
<!--#} -->
<script>
    layui.extend({
        loading: '../../../plugins/layui_extends/loading/loading',
    }).define([ 'form', 'laydate', 'table','loading','ncodebatchApi'], function(exports) {
        var form = layui.form;
        var ncodebatchApi = layui.ncodebatchApi;
        var index = layui.index;
        var laydate = layui.laydate;

        var view = {
            init:function(){
                Lib.initGenrealForm($("#addForm"),form);
                this.initSubmit();
            },
            initSubmit:function(){
                $("#addButton").click(function(){
                    // $("#addButton").hide();
                    // $("#addButton-loading").show();
                    // $("#addButton-loading").loading();
                    //

                    let expiredDate = $("#date").val();
                    if(expiredDate==""){
                        Common.info("请选择日期");
                        return;
                    }
                    form.on('submit(form)', function(){
                        ncodebatchApi.setTime($('#addForm'),function(){
                            parent.window.dataReload();
                            Common.info("保存成功");
                            Lib.closeFrame();
                        });
                    });
                });

                $("#addButton-cancel").click(function(){
                    Lib.closeFrame();
                });
            }

        }
        view.init();
    });
</script>
